<?php
$this->pageTitle     = 'Tìm kiếm  - ' . Option::getItem('site_name');
$this->meta_desc     = 'Tìm kiếm ';
$this->meta_keywords = 'Tìm kiếm ';
?>
<div class="content">
    <div class="main-wrap">
        <?php if ($posts): ?>
            <?php foreach ($posts as $post): ?>
                <div class="box-news ">
                    <div class="row-fluid">
                        <a href="<?php echo $post->publicUrl ?>" title="<?php echo $post->title ?>">
                            <img class="span5" src="<?php echo $post->getPublicPhoto(386, 265) ?>" alt="<?php echo $post->url ?>"/>
                        </a>
                        <div class=" span7 box-description">
                            <h3 class="title-product">
                                <a href="<?php echo $post->publicUrl ?>" title="<?php echo $post->title ?>">
                                    <?php echo $post->title ?>
                                </a>
                            </h3>
                            <div class="n-sum n-desc border-solid-footer">
                                <?php echo MyUtil::word_limiter($post->description, 160) ?>
                            </div>
                            <div class="view-more">
                                <a class=" btn btn-primary" href="<?php echo $post->publicUrl ?>" title="<?php echo $post->title ?>">
                                    Xem
                                </a>
                            </div>
                        </div>
                        <div class="clear"></div>
                    </div>
                </div>
            <?php endforeach; ?>
        <?php endif; ?>
        <?php if ($products): ?>
            <?php foreach ($products as $post): ?>
                <div class="box-news ">
                    <div class="row-fluid">
                        <a href="<?php echo $post->publicUrl ?>" title="<?php echo $post->name ?>">
                            <img class="span5" src="<?php echo $post->getPublicImage(386, 265) ?>" alt="<?php echo $post->url ?>"/>
                        </a>
                        <div class=" span7 box-description">
                            <h3 class="title-product ">
                                <a href="<?php echo $post->publicUrl ?>" title="<?php echo $post->name ?>">
                                    <?php echo $post->name ?>
                                </a>
                            </h3>
                            <div class="district">
                                <?php echo $post->category->name ?>
                            </div>
                            <div class="border-deshed">
                                <div>Giá: <b class="r-price">18500000.00</b></div>
                            </div>
                            <div class="n-sum border-solid-footer">
                                <?php echo MyUtil::word_limiter($post->description, 100) ?>
                            </div>
                            <div class="view-more">
                                <a class=" btn btn-primary" href="<?php echo $post->publicUrl ?>" title="<?php echo $post->name ?>">
                                    Xem
                                </a>
                                &nbsp;&nbsp;&nbsp;
                                <a class=" btn btn-success" href="<?php echo $post->publicUrl ?>" title="<?php echo $post->name ?>">
                                    Đăng ký tham quan
                                </a>
                                <div class="clear"></div>
                            </div>
                        </div>
                        <div class="clear"></div>
                    </div>
                </div>
            <?php endforeach; ?>
        <?php endif; ?>
        <div class="page">
            <?php
            $this->widget('CLinkPager', array(
                'pages'         => $pages,
                'header'        => '',
                'nextPageLabel' => 'Sau',
                'prevPageLabel' => 'Trước',
            ))
            ?>
        </div>
    </div>
</div>